var TagCollectionView = Backbone.View.extend({
	tagName: "ul",
	// className: "tag_list",
	events: {
        // 'click .edit': 'handleEditClick',
		// 'click .submit': 'handleSubmitClick',
    },
	
	initialize: function (args) {
		_.bindAll(this, 'addOne', 'addAll', 'render');
		this.model.bind('add',     this.addOne);
		this.model.bind('refresh', this.addAll);
		//this.model.bind('all',     this.render);
    },

    addOne: function (tag) {
		var view = new TagView({model: tag});
        $(this.el).append(view.render().el);
    },
	
	addAll: function() {
		this.model.each(this.addOne);
	},	
	
    handleEditClick: function () {
		// hide tags
		this.$('.tag_list')[0].hide();
		// transform tag collection into comma-delimited
		// text box + submit button: might have to create a separate view
    },
	
	handleSubmitClick: function () {
		// figure out what tags were added/deleted
		// loop through comma-delimited tags
			// if tag name is in tag collection, then skip
			// if it is not, create new tag
		// loop through tag collection
			// if tag name is in string, skip
			// if not, delete tag from collection or mark for delete
	
		// add / remove tags from database?
		
		// show tags
        //alert('you clicked the submit button' + this.model.get('title'));
    }
});
